<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.fredck.FCKeditor.*"  %>
<%@ taglib uri="/FCKeditor" prefix="FCK" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<% 
	String title = "当月计划";
	if(request.getParameter("title") != null)
	{
		if(request.getParameter("title").equals("essay"))
		title = "当月计划";
	}  
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN">
  

    <head>
    <script type="text/javascript" src="../js_editer/fckeditor.js"></script>
    <script type="text/javascript" src="../js/jquery.js"></script>
    <style type="text/css">@import url(../css/jquery-calendar.css);</style>
    <script type="text/javascript" src="../js/jquery-calendar.js"></script>
    <script type="text/javascript" src="../js/jquery-calendar-zh-cn.js"></script>
    <script type="text/javascript">
    function showTogether()
    {
  		if(document.getElementById('newsType_jq').value=='5'){
  			$("#togetherDiv").show("slow");
  		}else
  		{
  			$("#togetherDiv").hide("fast");
  		}
    };
    
	function setDate() {
	    var date = new Date();
	    day = date.getDate();
 		month = date.getMonth() + 1;
		year = date.getFullYear();
		var myDate = year+ '-' + month + '-' + day;
		document.getElementById('createTime').value=myDate;
	};
	$(document).ready(function(){
        $('#createTime').calendar({autoPopUp: 'both', buttonImageOnly: true,
		buttonImage: '../img/calendar.gif', buttonText: 'Calendar', yearRange: '-5:+5'});
		$('#effectiveTime').calendar({autoPopUp: 'both', buttonImageOnly: true,
		buttonImage: '../img/calendar.gif', buttonText: 'Calendar', yearRange: '-5:+5'});
		setDate();
		showTogether();
		$("#newsTitle_jq, #createTime").change(function(){
			$(this).css("background-color","#FFF");
			});
		$("#addnews_btn").click(function(){
			var alertText = "";
			var newsTitle = $("#newsTitle_jq").attr("value");
			if((newsTitle == undefined)||(newsTitle == null)){
				$("#newsTitle_jq").css("background-color","#FF9");
				alertText += "请输入新闻标题" + "\n";}
			var cTime = $("#createTime").attr("value");
			if((cTime == undefined)||(cTime == null)){
				alertText += "请选择发布时间" + "\n";}
			if(alertText != ""){
				alert(alertText);
				return false;}
		})
    });
	
    </script>
<title>添加<%=title%></title>
<link href="../css/mngMain.css" type="text/css" rel="stylesheet" />
</head>

  <body>
<div class="controlBox">
	<%@include file="../admin_top.jsp" %>
	<div class="mngMain">
		<div class="mngLeft">
			 <%@include file="../admin_menu.jsp" %>
		</div>
		<div class="mngRight">
			<div class="mngRightContainer">
				<div class="mngRightContainerT">添加<%=title%></div>
				<div class="mngRightContainerM">
				<html:form action="addProjet.do" method="post" styleId="createUserForm">
					
					<table>
						<tr>
							<td width="10%"></td>
							<td>
								<font color="red"><bean:write name="info" ignore="true" filter="false"/></font>																
								<input type="hidden" name="id" 								
								value='<logic:present name="id" scope="request"><bean:write name="id"/></logic:present>'/>								
							</td>
						</tr>

						<tr>
							<th>标题：</th>
						  	<td><input type="text" name="title" id="newsTitle_jq" /><span>*</span></td>
						</tr>
						
						<tr>
							<th>内容：</th>
							<td></td>
						</tr>
						<tr>
							<td colspan="2">
								<FCK:editor id="content" basePath="/js_editor/"
								       width="700"
								       height="400"
								       toolbarSet = "Default" >
								</FCK:editor>
							</td>
						</tr>
						<tr>
							<td colspan="2"><input type="submit" value="发布" src="../img/submitBtn.gif" id="addnews_btn" /></td>
						</tr>
					</table>
					</html:form>
				</div>
			</div>
		</div>
	</div>
	<div class="mngBottom">
		<div class="mngLine"></div>
	</div>
</div>
</body>
</html>
